<template>
  <div class="myTag">
    <div class="text_background" :style="{ 'background-color': selected ? activeColor : '' }">
      {{ i18n.t(text) }}
    </div>
    <div class="text" :class="{ text_selected: selected }">{{ i18n.t(text) }}</div>
    <div
      class="icon flex-center-center"
      :style="{ 'background-color': selected ? activeColor : '' }"
    >
      <img
        class="icon_img"
        src="@/assets/images/eight_electrodes_report/icon_selected.svg"
        alt=""
      />
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator'

@Component({ components: {} })
export default class extends Vue {
  @Prop({ default: '' }) text!: string
  @Prop({ default: '' }) activeColor!: string
  @Prop({ default: false }) selected!: boolean
}
</script>

<style lang="scss" scoped>
@import '@/assets/scss/main.scss';
.myTag {
  display: flex;
  height: rem(36);
  text-align: center;
  font-size: rem(22);
  line-height: rem(36);
  position: relative;
  .text_background {
    background-color: rgba(204, 204, 204, 1);
    color: rgba(1, 1, 1, 0);
    height: rem(36);
    opacity: 0.2;
    padding: 0 rem(10) 0 rem(16);
    border-radius: rem(18) 0 0 rem(18);
  }
  .text {
    color: #909090;
    position: absolute;
    left: rem(16);
    top: rem(1.5);
    &.text_selected {
      color: #2a2e31;
    }
  }
  .icon {
    height: rem(36);
    width: rem(36);
    border-radius: 0 rem(18) rem(18) 0;
    background: #cccccc;
    .icon_img {
      width: rem(22);
      height: rem(16);
    }
  }
}
</style>
